<?php
if(isset($_GET['opt']))
{
	$opt = $_GET['opt'];
	$moduleID = $moduleService->getModuleIDByFuncAndOpt($context, $result, $func, $opt);
	$permit = $permitService->checkPermition($context, $result, $_SESSION['user']['type'], $moduleID);
	if($opt == "add" && $permit ==true)
	{
		$smarty->display($templateDir . "/temp1/addBArtUser.tpl");
	}
	if($opt == "edit" && $permit ==true)
	{
		 
		if(isset($_GET['id']) && is_numeric($_GET['id']))
		{
			$bArtUser = $bartUserServices->getBArtUserByOid($context, $result, $_GET['id']);
			$smarty->assign('bArtUser', $bArtUser);
			$smarty->display($templateDir . "/temp1/editBArtUser.tpl");
		}
	}
	if($opt == "list" && $permit ==true)
	{
		$start=$p->findStart($configPage['limit']);
		$count=$bartUserServices->countAllBArtUser($context, $result);
		$pages=$p->findPages($count,$configPage['limit']);
		$page_list = $p->pagesList($_GET['page'],$pages,$configPage);
		$bartUserList = $bartUserServices->getAllBArtUserByRange($context, $result, $start, $configPage['limit']);
		$total = "Page ".$_GET['page']." in ".$pages. " Pages";
		$smarty->assign('total', $total);
		$smarty->assign('page_list', $page_list);
		$smarty->assign('bartUserList', $bartUserList);
		$smarty->display($templateDir . "/temp1/listBArtUser.tpl");
	}
	if($opt == "changePassU")
	{
		$smarty->display($templateDir . "/temp1/changePass.tpl");
			
	}
}
?>